﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;

namespace viBook.Models
{
    public abstract class Comment
    {
        public int Id { get; set; }
        [Required(ErrorMessage = "Content is required.")]
        [MaxLength(320, ErrorMessage = "Content cannot be longer than 320 characters.")]
        public string Content { get; set; }
        public DateTime CreatedDate { get; set; }
        public int Like { get; set; }
        public bool IsBlocked { get; set; }

        public int UserId { get; set; }

        public virtual User User { get; set; }

        [NotMapped]
        public bool IsLiked { set; get; }
        [NotMapped]
        public bool IsReported { get; set; } 
        [NotMapped]
        public bool IsAuthorized { get; set; }

    }

    public class ChapterComment : Comment
    {
        public int ChapterId { get; set; }
        public virtual Chapter Chapter { get; set; }
    }

    public class BookComment : Comment
    {
        public int BookId { get; set; }
        public virtual Book Book { get; set; }

    }
}